<template>
	<view>
		<view class="" v-if="list.length">
<!-- 			<u-cell-group>
				<u-cell v-for="(item, index) in list"  size="large"  @click="getDetail(item)" isLink :key="index" :title="item.xtName"
					:label="item.xtPhone" center :value="getXtRelationship(item)">

				</u-cell>
			</u-cell-group> -->
			
			
			<u-cell-group v-if="list.length !=0">
				<u-cell @click="getDetail(item)" v-for="(item,index) in list"  size="large"  :name="item.deliveryAddressId" :key="index"
					class="ms10 mt10" isLink :border="false">
					<text slot="title" class="u-slot-value">
						{{item.xtName}}
					</text>
					<text slot="label" class="u-slot-value">
						{{item.xtPhone}}
					</text>
					<text slot="value" class="u-slot-value">
						{{getXtRelationship(item)}}
					</text>
				</u-cell>
			</u-cell-group>
			
			
			
		</view>
		<u-empty mode="data" v-else> </u-empty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
			};
		},
		methods: {
			getDetail(item) {
				uni.navigateTo({
					url: `/pages_my/addFamily/addFamily?data=${encodeURIComponent(
		  JSON.stringify(item))}`,
				});
			},
			getXtRelationship(obj) {
				switch (obj.xtRelationship) {
					case "0":
						return "本人"
						break;
					case "1":
						return "父母"
						break;
					case "2":
						return "兄妹"
						break;
					case "3":
						return "儿女";
						break;
					case "4":
						return "其他";
						break;
				}
			},
			async getList() {
				/*  */
				let re = await this.$API.familyApi.getList();
				this.list = re;
			},
		},
		onNavigationBarButtonTap(e) {
			uni.navigateTo({
				url: "/pages/addFamily/addFamily",
			});
		},
		onShow() {
			this.getList();
		},
	};
</script>

<style lang="scss">
 ::v-deep .u-cell__title-text--large{
	 font-size: 62rpx !important;
 }
 .u-slot-value{
	font-size: 40rpx !important;
 }
</style>